import HTTP from './http'
import api from './api'
export default {
  // 用户管理
  USER_LOGIN(payload) {
    return HTTP('POST', api.user.login, payload)
  },
  USER_LOGOUT(payload) {
    return HTTP('POST', api.user.logout, payload)
  },
  USER_INFO(payload) {
    return HTTP('POST', api.user.info, payload)
  },
  USER_GROUP(payload) {
    return HTTP('POST', api.user.group, payload)
  },

  // 屏幕管理
  DISPLAYS_LIST(payload) {
    return HTTP('GET', api.displays.list, payload)
  },
  DISPLAYS_ADD(payload) {
    return HTTP('POST', api.displays.save, payload)
  },
  DISPLAYS_ADD_BY_TEMPLATE() {
    // 失效
  },
  DISPLAYS_COPY_BY_TEMPLATE(payload) {
    return HTTP('POST', api.displays.copytemplate, payload)
  },
  DISPLAYS_EDIT(payload) {
    return HTTP('POST', api.displays.edit, payload)
  },
  DISPLAYS_REMOVE(payload) {
    return HTTP('POST', api.displays.remove, payload)
  },
  DISPLAYS_RELEASE(payload) {
    return HTTP('POST', api.displays.release, payload)
  },
  DISPLAYS_SAVEALL(payload) {
    return HTTP('POST', api.displays.saveAll, payload)
  },
  DISPLAYS_GET(payload) {
    return HTTP('GET', api.displays.get, payload)
  },
  DISPLAYS_PREVIEW(payload) {
    return  HTTP('GET', api.displays.releaselist, payload)
  },
  DISPLAYS_SAVE_TEMPLATE(payload) {
    return HTTP('POST', api.displays.template, payload)
  },
  DISPLAYS_LIST_TEMPLATE() {
    return HTTP('POST', api.displays.listtemplate)
  },
  

  CHARTS_LIST(payload) {
    return HTTP('GET', api.charts.list, payload)
  },
  CHARTS_ADD(payload) {
    return HTTP('POST', api.charts.add, payload)
  },
  CHARTS_GET(payload) {
    return HTTP('GET', api.charts.get, payload)
  },
  CHARTS_REMOVE(payload) {
    return HTTP('POST', api.charts.remove, payload)
  },
  CHARTS_OPTION(payload) {
    return HTTP('GET', api.charts.option, payload)
  },
  CHARTS_UPDATE(payload) {
    return HTTP('POST', api.charts.update, payload)
  },
  CHARTS_MAP() {
    return HTTP('GET', api.charts.mapdata)
  },


  DATABASE_LIST() {
    return HTTP('GET', api.database.list)
  },
  DATABASE_REMOVE(payload) {
    return HTTP('POST', api.database.remove, payload)
  },
  DATABASE_ADD(payload) {
    return HTTP('POST', api.database.add, payload)
  },
  DATABASE_TEST(payload) {
    return HTTP('POST', api.database.test, payload)
  },
  DATABASE_EDIT(payload) {
    return HTTP('POST', api.database.edit, payload)
  },
  DATABASE_TYPE(payload) {
    return HTTP('GET', api.database.type, payload)
  },
  DATABASE_DRIVER(payload) {
    return HTTP('GET', api.database.driver, payload)
  },

  SQL_LIST(payload) {
    return HTTP('GET', api.sql.list, payload)
  },
  SQL_REMOVE(payload) {
    return HTTP('POST', api.sql.remove, payload)
  },
  SQL_TEST(payload) {
    return HTTP('POST', api.sql.test, payload)
  },
  SQL_EDIT(payload) {
    return HTTP('POST', api.sql.edit, payload)
  },
  SQL_ADD(payload) {
    return HTTP('POST', api.sql.add, payload)
  },

  API_LIST(payload) {
    return HTTP('GET', api.api.list, payload)
  },
  API_ADD(payload) {
    return HTTP('POST', api.api.save, payload)
  },
  API_REMOVE(payload) {
    return HTTP('POST', api.api.remove, payload)
  },
  API_UPDATE(payload) {
    return HTTP('POST', api.api.update, payload)
  },
  API_TEST(payload) {
    return HTTP('GET', api.api.test, payload)
  },

  // DRILL
  DRILL_GET(payload) {
    return HTTP('GET', api.drill.get, payload)
  },
  DRILL_OPTION(payload) {
    return HTTP('GET', api.drill.option, payload)
  },
  DRILL_LIST(payload) {
    return HTTP('GET', api.drill.list, payload)
  },
  DRILL_ADD(payload) {
    return HTTP('POST', api.drill.save, payload)
  },
  DRILL_EDIT(payload) {
    return HTTP('POST', api.drill.update, payload)
  },
  DRILL_REMOVE(payload) {
    return HTTP('POST', api.drill.remove, payload)
  },

  WEATHER(payload) {
    return HTTP('GET', api.weather, payload)
  }
}
